package com.yjz.normal_skill.properties文件读取;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class PropertiesTets {

  private static final Logger log = LoggerFactory.getLogger(PropertiesTets.class);

  @Test
  public void readProperties() throws IOException {
    InputStream in = PropertiesTets.class.getClassLoader().getResourceAsStream("configure/runtime.properties");
    Properties p = new Properties();
    p.load(in);
    in.close();
    //处理乱码问题
    String value2 = new String(p.getProperty(("address")).getBytes("ISO-8859-1"), "GBK");
    log.info(value2);

  }
}
